import Net from "../../common"
Page({
  data: {
    list: []
  },
  onLoad: function (options) {
    var _this = this
    _this.onPageInfo()
  },
  onPageInfo() {
    Net.link('v1/bindGoods', {}, function (res) {
      Net.data({
        list: res.data.data.list
      });
    }, "GET")
  },
  upGoods(e) {
    let pages = getCurrentPages();
    let prevPage = pages[pages.length - 2],
      data = {}
    for (let i in Net.data('list')) {
      if (Net.data('list')[i].tao_id == e.currentTarget.id) {
        data = Net.data('list')[i]
      }
    }
    prevPage.setData({
      hidden: false,
      goodsInfo:data
    });
    wx.navigateBack({
      delta: 1
    })
  },
  onReady: function () {},
  onShow: function () {},
  onHide: function () {},
  onUnload: function () {},
  onPullDownRefresh: function () {},
  onReachBottom: function () {},
  onShareAppMessage: function () {}
})